import { PrismaClient } from '@prisma/client';
import bcrypt from 'bcrypt'
const prisma = new PrismaClient();
import { BCRYPT_SALT, ROBOT_ID, ADMIN_ID } from '../src/constants/normal.constants';

async function main() {
    console.log('Seeding started...');
    const password = await bcrypt.hash('a123456', BCRYPT_SALT);
    await prisma.user.createMany({
        data: [
            { userId: ADMIN_ID, nickname: 'Admin', email: 'admin@mail.com', password },
            { userId: ROBOT_ID, nickname: 'EasyChat', email: 'easychat@mail.com', password },
        ],
    });
}

main()
    .catch((e) => {
        console.error(e);
        process.exit(1);
    })
    .finally(async () => {
        await prisma.$disconnect();
        console.log('Seeding completed.');
    });